package com.foomia.truego.http;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;

import org.apache.http.NameValuePair;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpRequestBase;

import com.foomia.truego.parsers.json.Parser;
import com.foomia.truego.types.TruegoType;
import com.foomia.truegoed.error.TruegoCredentialsException;
import com.foomia.truegoed.error.TruegoException;
import com.foomia.truegoed.error.TruegoParseException;

public interface HttpApi {
	abstract public TruegoType doHttpRequest(HttpRequestBase httpRequest,
			Parser<? extends TruegoType> parser)
			throws TruegoCredentialsException, TruegoParseException,
			TruegoException, IOException;

	abstract public String doHttpPost(String url,
			NameValuePair... nameValuePairs)
			throws TruegoCredentialsException, TruegoParseException,
			TruegoException, IOException;

	abstract public HttpGet createHttpGet(String url,
			NameValuePair... nameValuePairs);

	abstract public HttpPost createHttpPost(String url,
			NameValuePair... nameValuePairs);

	abstract public HttpURLConnection createHttpURLConnectionPost(URL url,
			String boundary) throws IOException;

}
